
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@taglib prefix="mvc" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://www.springframework.org/tags" %>

<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>预算审批</title>
    <link rel="stylesheet" href="/css/officialDocument/officialDocument.css">
    <link rel="stylesheet" href="/lib/layer/skin/default/layer.css">
    <link rel="stylesheet" href="/lib/pagination/style/pagination.css">
    <link rel="stylesheet" href="/lib/laydate/need/laydate.css">
    <link rel="stylesheet" href="/css/base.css">
    <link rel="stylesheet" type="text/css" href="/css/commonTheme/${sessionScope.InterfaceModel}/commonTheme.css"/>
    <script src="/js/common/language.js"></script>
    <script type="text/javascript" src="/js/jquery/jquery-1.9.1.js"></script>
    <script src="/lib/layer/layer.js?20201106"></script>
    <script src="/js/base/base.js"></script>
    <script src="/lib/laydate/laydate.js"></script>
    <script src="/lib/pagination/js/jquery.pagination.min.js" type="text/javascript" charset="utf-8"></script>

    <style>
        table{
            table-layout: fixed;
        }
        table thead th{
            width:100%;
           /* border: #ccc 1px solid;*/
            height:30px;
            color: rgb(47, 92, 143);
            font-size: 13px;
        }
        table td a:hover{
            color: #CC2222;
            text-decoration: underline;
        }
        table tr>td{
            width:30px;
            overflow: hidden;
            text-overflow:ellipsis;
            white-space: nowrap;
            font-size: 13px;
            height:40px;
            line-height:40px;
           /* border: #ccc 1px solid;*/
            text-align: center;
            overflow: hidden;
            text-overflow:ellipsis;
            white-space: nowrap;
            padding: 0;
        }
        .M-box3{
            margin-top: 30px;
            position: fixed;
            bottom:10px;
            right: 60px;
            text-align: center;
        }
        .M-box3 .active{
            margin: 0px 3px;
            width: 38px;
            height: 38px;
            line-height: 38px;
            background: #2b7fe0;
            font-size: 12px;
            border: 1px solid #2b7fe0;
            color:#fff;
            text-align:center;
            display: inline-block;
        }
        .M-box3 a{
            margin: 0 3px;
            width: 38px;
            height: 38px;
            line-height: 38px;
            font-size: 12px;
            display: inline-block;
            text-align:center;
            background: #fff;
            border: 1px solid #ebebeb;
            color: #333;
            text-decoration: none;
        }
        .jump-ipt {
            width: 38px;
            height: 38px;
            line-height: 38px;
            text-align: center;
            padding: 0;
        }
        .clearfix1:after {
            display: table;
            content: " ";
            clear: both;
        }
        .clearfix1{
            border-bottom:1px solid #9e9e9e;
            /*margin-bottom: 16px;*/
            height:34px;
            margin-top: 11px;
        }
        .div_IMG {
            float: left;
            width: 20px;
            height: 100%;
            margin-left: 5px;
        }
        .div_Img img {
            float: left;
            margin-left: 30px;
            margin-top: 0px;
            width: 26px;
            height: 26px;
        }
        .p1{
            float: left;
            margin-bottom: 0;
            height: 30px;
            padding-left: 40px;
            font-size: 18px;
            line-height: 30px;
            color: #333;
        }
        #uploadTable tr:nth-child(2n+1) {
            background-color: rgb(246, 247, 249);
        }
        #uploadTable tr:nth-child(2n) {
            background-color: rgb(255, 255, 255);
        }
        #uploadTable tr {
            border-width: 1px;
            border-style: solid;
            border-color: rgb(192, 192, 192);
            border-image: initial;
        }
        #uploadTable tr:hover{
            background-color:#d3e6f9;
        }
        .Query{
            padding: 5px 10px 5px 37px;
            background: #2b7edf url(../../img/taisousuo.png) no-repeat 17px 8px;
        }
    </style>
    <link rel="stylesheet" type="text/css" href="/css/commonTheme/${sessionScope.InterfaceModel}/commonTheme.css"/>
</head>
<body>
<div class="clearfix1">
    <div class="div_Img">
        <img src="/img/yszxsb.png" style="vertical-align: middle;" alt="菜单主分类设置">
    </div>
    <p class="p1">预算执行审批</p>

</div>
<div style="height: 60px;width: 97%;padding-left: 28px" class="clearfix">
    <label class="fl clearfix" style="margin-top: 16px;margin-left: 10px;">
        <span class="fl" style="margin-top: 5px;">办理状态：</span>
        <label class="fl"><select name="status" id="zt">
            <option value="1">待办</option>
            <option value="2">已办</option>
        </select></label>
        <button type="button" class="Query fl" style="width: 76px">查询</button>
    </label>
</div>
<div class="pagediv" style="margin: 0 auto;width: 97%;">
    <table cellspacing="0" cellpadding="0" style="border-collapse:collapse;width:80%;margin:10px auto;" id="uploadTable">
        <thead>
        <tr class="busTravelData" style="background: none">
            <th>流水号</th>
            <th>流程名称</th>
            <th>申请人</th>
            <th>部门</th>
            <th>申请时间</th>
            <th>用途说明</th>
            <th>当前步骤</th>
            <th>状态</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody></tbody>
    </table>
</div>
<div id="dbgz_page" class="M-box3 fr"><span class="active">1</span><a href="javascript:;" data-page="2">2</a><a href="javascript:;" class="next">&gt;</a><input type="text" class="jump-ipt"><a href="javascript:;" class="jump-btn">跳转</a></div>
</body>
<script>
    function openRold(){
        location.reload();
    }
</script>
<script>
    //处理undefind
    function undefindData(data) {
        if(data == undefined){
            return '';
        }else{
            return data;
        }
    }
    $('.Query').click(function(){
        var allow=$("#zt option:selected").val();
        console.log(allow)
        ajaxPageTr.data.num = allow;
        ajaxPageTr.page();
    })
   var ajaxPageTr={
        data:{
            page:1,//当前处于第几页
            pageSize:5,//一页显示几条
            useFlag:true,
            num:1
            // computationNumber:null
        },
        page:function () {
            $('.busTravelData').siblings().remove();
            var me=this;
            layer.msg('加载中', {
                icon: 16
                ,shade: 0.01
            });
            $.ajax({
                type:'get',
                url:'/budget/approvalProcess',
                dataType:'json',
                data:me.data,
                success:function(res){
                    var data=res.datas;
                    var str='';
                    $.each(res.datas, function (index, item) {
                        str += '<tr flowID='+item.flowId+' flowStep= '+item.step+' runId='+item.runId+' prcsId='+item.prcsId+'>' +
                            '<td title='+item.runId+'>' + item.runId+ '</td>' +
                            '<td title="'+item.runName +'">' + item.runName + '</td>' +
                            '<td title="'+item.applicantName+'">' + item.applicantName+ '</td>' +
                            '<td title="'+item.deptId +'">' + item.deptId + '</td>' +
                            '<td title="'+item.applicationDate +'">' + item.applicationDate + '</td>' +
                            '<td title="'+undefindData(item.instructions)+'">' + undefindData(item.instructions) + '</td>' +
                            '<td title=第'+item.step+'步：'+item.prcsName+'>第'+item.step+'步：'+item.prcsName+'</td>' +
                            '<td>'+function () {
                                if(item.prFlag==1){
                                    return '<fmt:message code="lang.th.will" />'
                                }else  if(item.prFlag==2){
                                    return '<fmt:message code="lang.th.Process" />'
                                }else  if(item.prFlag==3){
                                    return '<fmt:message code="lang.th.will" />'
                                }else{
                                    return '<fmt:message code="lang.th.HaveThrough" />'
                                }
                            }()+'</td>' +
                            '<td><a href="/workflow/work/workform?opflag=1&flowId='+item.flowId+'&flowStep='+item.step+'&runId='+item.runId+'&tableName='+item.tableName+'&prcsId='+item.realPrcsId+'&tabId='+item.id+'" target="_blank" style="margin-right: 10px">办理</a>' +
                            '<a href="/workflow/work/workformPreView?flowId='+item.flowId+'&flowStep='+item.step+'&tableName=budget&runId='+item.runId+'&tableName='+item.tableName+'&prcsId='+item.realPrcsId+'" target="_blank" style="margin-right: 10px">查看详情</a></td>' +
                            '</tr>';

                    })
                    $('tbody').html(str)
                    layer.closeAll();
                    me.pageTwo(res.total,me.data.pageSize,me.data.page)
                }
            })

        },
        pageTwo:function (totalData, pageSize,indexs) {
            var mes=this;
            $('#dbgz_page').pagination({
                totalData: totalData,
                showData: pageSize,
                prevContent:'上一页',
                nextContent:'下一页',
                jump: true,
                coping: true,
                homePage:'',
                endPage: '',
                current:indexs||1,
                callback: function (index) {
                    mes.data.page=index.getCurrent();
                    mes.page();
                }
            });
        }
    }
    ajaxPageTr.page();

</script>

</html>


